package com.d0324;

import java.util.Arrays;

public class TestSort {
    public static void main(String[] args) throws Exception{
        Product p1=new Product("巧克力",419,2);
        Product p2=new Product("面包",13.1,3);
        Product p3=new Product("奶油",40.2,4);
        Product p4=new Product("草莓",31,5);
        Product[] products= new Product[]{p1,p2,p3,p4};
        Arrays.sort(products);
        for (Product pro:products){
            System.out.println(pro);
        }
    }
}
